home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / mus / play / dmdev.lha / delfinampeg.device / src / device.asm < prev    next >
Assembly Source File  |  2000-11-04  |  15KB  |  636 lines

  1. ;*****************************************************************************
  2. ;
  3. ;    delfinampeg.device - mpeg.device for Delfina DSP
  4. ;    Copyright (C) 2000  Michael Henke
  5. ;
  6. ;    This program is free software; you can redistribute it and/or modify
  7. ;    it under the terms of the GNU General Public License as published by
  8. ;    the Free Software Foundation; either version 2 of the License, or
  9. ;    (at your option) any later version.
  10. ;
  11. ;    This program is distributed in the hope that it will be useful,
  12. ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;    GNU General Public License for more details.
  15. ;
  16. ;    You should have received a copy of the GNU General Public License
  17. ;    along with this program; if not, write to the Free Software
  18. ;    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19. ;
  20. ;*****************************************************************************
  21.  
  22.  
  23. ;** based on the framework of melodympeg.device
  24. ;** (C) Copyright 1998-2000 Kato Development (Thorsten Hansen)
  25.  
  26.  
  27. VERSION        EQU    1
  28. REVISION    EQU    0
  29.  
  30. ; Hiermit wird das Device nach dem schliessen wieder automatisch
  31. ; aus dem System entfernt (EXPUNGE = 1). Sonst auf 0 setzen.
  32. ;EXPUNGE        SET    1
  33.  
  34.  
  35.     include "exec/exec.i"
  36.     include "hardware/intbits.i"
  37.     include "libraries/configvars.i"
  38.     include "libraries/configregs.i"
  39.     include "utility/utility.i"
  40.     include "utility/tagitem.i"
  41.  
  42.     include    "melodympeg.i"
  43.  
  44.     XDEF    _DevName
  45.     XDEF    _DelfinaBase
  46.  
  47.     XREF    _C_initunit    ;unit init
  48.     XREF    _C_expungeunit    ;unit expunge
  49.     XREF    _C_setpause    ;MPEGCMD_PAUSE
  50.     XREF    _C_setvolume    ;MPEGCMD_SETAUDIOPARAMS
  51.     XREF    _C_flush    ;CMD_FLUSH
  52.     XREF    _C_write    ;CMD_WRITE
  53.  
  54. *
  55. * Device Data Structure
  56. *
  57.  
  58. MAX_UNITS    equ    1
  59.  
  60. ; Hier Device globale Daten sichern (Library ptr, etc.)
  61.  
  62.  STRUCTURE MelodyDev,LIB_SIZE
  63.     UBYTE    md_Flags
  64.     UBYTE    md_Pad1
  65.     APTR    md_SysLib
  66.     APTR    md_SegList
  67.     STRUCT    md_Units,MAX_UNITS*4    ; Unit Ptr
  68.     APTR    md_DelfinaBase        ;!!!
  69.     LABEL    MelodyDev_SIZE
  70.  
  71.  
  72.  
  73. ****************************************************************************
  74.  
  75.  
  76.  
  77.     section    mycode,code
  78.  
  79.         moveq #-1,d0        ;don't try do run this!
  80.         rts                                
  81.  
  82. InitTable    dc.w    RTC_MATCHWORD
  83.         dc.l    InitTable
  84.         dc.l    EndCode
  85.         dc.b    RTF_AUTOINIT
  86.         dc.b    VERSION
  87.         dc.b    NT_DEVICE
  88.         dc.b    0        ;DevPri
  89.         dc.l    _DevName
  90.         dc.l    IDString
  91.         dc.l    Init__
  92.  
  93. _DevName    dc.b    "delfinampeg.device",0
  94.  
  95.         dc.b    "$VER:"
  96. IDString    dc.b    "delfinampeg.device 1.0 (04.11.2000)"
  97.         dc.b    " written by Michael Henke",0
  98.  
  99. delflibname    dc.b    "delfina.library",0
  100.  
  101.  
  102. *
  103. * board description (256 byte)
  104. *
  105. * Dies ist eine kurze Beschreibung des MPEG Device. Diese kann von
  106. * der Anwendung abgefragt werden.
  107. *
  108.     cnop    0,4
  109. BoardDesc
  110.     dc.b    "MPEG audio decoder for Delfina DSP."
  111.     dc.b    " supports MPEG-1 audio Layer II/III."
  112.     dc.b    " written by Michael Henke."
  113. endtext
  114.     dcb.b    256-(endtext-BoardDesc),0
  115.  
  116.         cnop    0,4
  117.  
  118. _DelfinaBase    dc.l    0    ;filled by device Init routine
  119.  
  120. Init__        dc.l    MelodyDev_SIZE
  121.         dc.l    funcTable
  122.         dc.l    dataTable
  123.         dc.l    initRoutine
  124.  
  125. funcTable    dc.l    Open__
  126.         dc.l    Close__
  127.         dc.l    Expunge__
  128.         dc.l    Null
  129.         dc.l    BeginIO__
  130.         dc.l    AbortIO__
  131.         dc.l    SetSCR__
  132.         dc.l    GetSCR__
  133.         dc.l    Null
  134.         dc.l    Null
  135.         dc.l    -1
  136.  
  137. dataTable
  138.     INITBYTE    LN_TYPE,NT_DEVICE
  139.     INITLONG    LN_NAME,_DevName
  140.     INITBYTE    LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
  141.     INITWORD    LIB_VERSION,VERSION
  142.     INITWORD    LIB_REVISION,REVISION
  143.     INITLONG    LIB_IDSTRING,IDString
  144.     dc.l    0
  145.  
  146.  
  147.  
  148.  
  149. ****************************************************************************
  150. *
  151. * This routine is called on the first device initialization
  152. *
  153. * -> d0 = device ptr, a0 = segment list, a6 = execbase
  154. *
  155. initRoutine
  156.     movem.l    d1-d7/a0-a6,-(a7)
  157.     move.l    d0,a5            ;device ptr
  158.     move.l    a6,md_SysLib(a5)    ;save ptr to exec
  159.     move.l    a0,md_SegList(a5)    ;save ptr to our loaded code
  160.  
  161.     lea    delflibname(pc),a1
  162.     moveq    #4,d0
  163.     jsr    -552(a6)        ;CALL OpenLibrary
  164.     move.l    d0,_DelfinaBase        ;global - for the 'C' routines
  165.     beq.b    .init_end        ;error: can't open delfina.library v4
  166.  
  167.     move.l    a5,d0            ;no error: return device
  168. .init_end
  169.     movem.l    (a7)+,d1-d7/a0-a6
  170.     rts
  171.  
  172.  
  173.  
  174.  
  175. ****************************************************************************
  176. *
  177. * Open wird beim öffnen des Device aufgerufen
  178. *
  179. * -> d0=unitnum, d1=flags, a1=ioreq, a6=device
  180. *
  181. Open__
  182.     movem.l    d2-d7/a0-a6,-(a7)
  183.     move.l    a6,a5            ; device
  184.     move.l    a1,a2
  185. ;----     valid unit number?
  186.     cmp.l    #MAX_UNITS,d0
  187.     bge    .open_err
  188. ;----     unit already initialized?
  189.     move.l    d0,d3
  190.     lea    md_Units(a5,d0.w*4),a4    ; unit ptr
  191.     move.l    (a4),d0
  192.     bne.b    .open_err
  193.     bsr    InitUnit        ; unit:d3, devptr:a5
  194. ;----     see if it initialized OK
  195.     move.l    (a4),d0
  196.     beq.b    .open_err
  197.     move.l    d0,IO_UNIT(a2)
  198.     addq    #1,LIB_OPENCNT(a5)
  199. ;----     prevent delayed expunges
  200.     bclr    #LIBB_DELEXP,md_Flags(a6)
  201.     moveq    #0,d0
  202.     move.b    d0,IO_ERROR(a2)
  203.     move.b    #NT_REPLYMSG,LN_TYPE(a2) ; Mark IORequest as "complete" !
  204. .open_end
  205.     movem.l    (a7)+,d2-d7/a0-a6
  206.     rts
  207. .open_err
  208.     moveq    #IOERR_OPENFAIL,d0
  209.     move.b    d0,IO_ERROR(a2)
  210.     move.l    d0,IO_DEVICE(a2)    ;IMPORTANT: trash IO_DEVICE on open failure
  211.     bra.b    .open_end
  212.  
  213.  
  214.  
  215. ****************************************************************************
  216. *
  217. * Close wird beim schliessen des Device aufgerufen
  218. *
  219. * -> a1=ioreq, a6=device
  220. * <- d0=seglist oder 0
  221. *
  222. Close__
  223.     movem.l    d1-d7/a1-a5,-(a7)
  224.     move.l    a6,a5            ; device ptr
  225.     move.l    IO_UNIT(a1),a3
  226.     moveq    #0,d0
  227.     move.l    a3,d1
  228.     beq.b    .close_end        ; unit ist schon geschlossen
  229. ;----     unit can be only open once one
  230.     clr.l    IO_UNIT(a1)
  231.     bsr    ExpungeUnit
  232.     moveq    #0,d0
  233.     subq    #1,LIB_OPENCNT(a6)
  234.     bne.b    .close_end
  235. ;----     see if we have a delayed expunge pending
  236.     IFND    EXPUNGE
  237.     btst    #LIBB_DELEXP,md_Flags(a6)
  238.     beq.b    .close_end
  239.     ENDC
  240.     bsr.b    Expunge__
  241. .close_end
  242.     movem.l   (a7)+,d1-d7/a1-a5
  243.     rts
  244.  
  245.  
  246.  
  247. ****************************************************************************
  248. *
  249. * Device entfernen
  250. *
  251. * -> a6=device
  252. *
  253. Expunge__
  254.     movem.l    d1-d2/a5-a6,-(a7)
  255.     move.l    a6,a5            ; device ptr
  256.     move.l    md_SysLib(a5),a6    ; ExecBase nach a6
  257.     tst    LIB_OPENCNT(a5)
  258.     beq.b    .exp_ok
  259. ;----     it is still open.  set the delayed expunge flag
  260.     bset    #LIBB_DELEXP,md_Flags(a5)
  261.     moveq    #0,d0
  262.     bra.b    .exp_end
  263. ;----     device wird entfernt
  264. .exp_ok    move.l    md_SegList(a5),d2    ; Zeiger auf Segment Liste
  265.     move.l    a5,a1            ; device
  266.     jsr    -252(a6)        ;CALL Remove  Device aus Liste löschen
  267.  
  268.     move.l    _DelfinaBase(pc),d0
  269.     beq.b    .no_delflib
  270.     move.l    d0,a1
  271.     jsr    -414(a6)        ;CALL CloseLibrary
  272. .no_delflib
  273.  
  274.     move.l    a5,a1            ; device
  275.     moveq    #0,d0
  276.     move    LIB_NEGSIZE(a5),d0
  277.     sub.l    d0,a1            ; Anfang des Speichers für device
  278.     add    LIB_POSSIZE(a5),d0    ; Laenge vom Device bestimmen
  279.     jsr    -210(a6)        ;CALL FreeMem  Speicher freigeben
  280.     move.l    d2,d0            ; Segment Liste
  281. .exp_end
  282.     movem.l    (a7)+,d1-d2/a5-a6
  283.     rts
  284.  
  285.  
  286.  
  287. Null    moveq    #0,d0
  288.     rts
  289.  
  290.  
  291. ****************************************************************************
  292. *
  293. * -> d3=unitnum, a5=device
  294. *
  295. InitUnit:
  296.     movem.l    d1-d7/a0-a6,-(a7)
  297.     move.l    d3,-(a7)        ;ULONG unitnum
  298.     jsr    _C_initunit        ;returns unit pointer
  299.     addq.l    #4,a7
  300.     movem.l    (a7)+,d1-d7/a0-a6
  301.     move.l    d0,md_Units(a5,d3.w*4)    ;store unit pointer
  302.     rts
  303.  
  304.  
  305. ****************************************************************************
  306. *
  307. * -> a3=unit, a5=device
  308. *
  309. ExpungeUnit:
  310.     movem.l    d1-d7/a0-a6,-(a7)
  311.     move.l    a3,-(a7)        ;struct devunit*
  312.     jsr    _C_expungeunit        ;returns ULONG unitnum
  313.     addq.l    #4,a7
  314.     movem.l    (a7)+,d1-d7/a0-a6
  315.     clr.l    md_Units(a5,d0.w*4)    ;clear unit pointer
  316.     rts
  317.  
  318.  
  319. ****************************************************************************
  320.  
  321. NSCMD_DEVICEQUERY    EQU    $4000
  322.  
  323.  STRUCTURE NSDeviceQueryResult,0
  324.     ULONG    dqr_DevQueryFormat
  325.     ULONG    dqr_SizeAvailable
  326.     UWORD    dqr_DeviceType
  327.     UWORD    dqr_DeviceSubType
  328.     APTR    dqr_SupportedCommands
  329.     LABEL    NSDeviceQueryResult_SIZEOF
  330.  
  331. NSDEVTYPE_UNKNOWN    EQU    0
  332.  
  333. cmdtable
  334.     dc.l    Invalid        ;0  CMD_INVALID
  335.     dc.l    CMD_Reset__    ;1  CMD_RESET
  336.     dc.l    CMD_Read__    ;2  CMD_READ            ; no op
  337.     dc.l    CMD_Write__    ;3  CMD_WRITE
  338.     dc.l    CMD_Update__    ;4  CMD_UPDATE            ; no op
  339.     dc.l    CMD_Clear__    ;5  CMD_CLEAR            ; no op
  340.     dc.l    CMD_Stop__    ;6  CMD_STOP            ; no op
  341.     dc.l    CMD_Start__    ;7  CMD_START            ; no op
  342.     dc.l    CMD_Flush__    ;8  CMD_FLUSH
  343.     dc.l    MPEG_Play    ;9  MPEGCMD_PLAY
  344.     dc.l    MPEG_Pause    ;A  MPEGCMD_PAUSE
  345.     dc.l    Invalid        ;B  MPEGCMD_SLOWMOTION        ; Not supported
  346.     dc.l    Invalid        ;C  MPEGCMD_SINGLESTEP        ; Not supported
  347.     dc.l    Invalid        ;D  MPEGCMD_SEARCH        ; Not supported
  348.     dc.l    Invalid        ;E  MPEGCMD_RECORD        ; Not supported
  349.     dc.l    MPEG_GetDevInfo ;F  MPEGCMD_GETDEVINFO
  350.     dc.l    Invalid        ;0  MPEGCMD_SETWINDOW        ; Not supported
  351.     dc.l    Invalid        ;1  MPEGCMD_SETBORDER        ; Not supported
  352.     dc.l    Invalid        ;2  MPEGCMD_GETVIDEOPARAMS    ; Not supported
  353.     dc.l    Invalid        ;3  MPEGCMD_SETVIDEOPARAMS    ; Not supported
  354.     dc.l    MPEG_SetAudPara ;4  MPEGCMD_SETAUDIOPARAMS
  355.     dc.l    Invalid        ;5  MPEGCMD_PLAYLSN        ; Not supported
  356.     dc.l    Invalid        ;6  MPEGCMD_SEEKLSN        ; Not supported
  357.     dc.l    Invalid        ;7  MPEGCMD_READFRAMEYUV    ; Not supported
  358.  
  359. cmdlist
  360.     dc.b    CMD_RESET
  361.     dc.b    CMD_WRITE
  362.     dc.b    CMD_FLUSH
  363.     dc.b    MPEGCMD_PLAY
  364.     dc.b    MPEGCMD_PAUSE
  365.     dc.b    MPEGCMD_GETDEVINFO
  366.     dc.b    MPEGCMD_SETAUDIOPARAMS
  367.     dc.b    MPEGCMD_SETEQUALIZER
  368.     dc.b    0
  369.  
  370.     cnop    0,4
  371.  
  372.  
  373.  
  374. ****************************************************************************
  375. *
  376. * BeginIO starts all incoming io. The IO is either queued up for the
  377. * unit task or processed immediately.
  378. *
  379. * -> a1=ioreq, a6=device
  380. *
  381. BeginIO__
  382.     movem.l    d1/a0/a3,-(a7)
  383.     move.b    #NT_MESSAGE,LN_TYPE(a1)    ; So WaitIO() is guaranteed to work
  384.     move.l    IO_UNIT(a1),a3        ; unit ptr
  385.     move    IO_COMMAND(a1),d0
  386.     ; NS device query test
  387.     cmp    #NSCMD_DEVICEQUERY,d0
  388.     bne.b    .no_nsdquery
  389.     bsr    NSDQuery
  390.     bra.b    .beginio_end
  391. .no_nsdquery
  392.     ; a valid command ?
  393.     cmp    #MPEGCMD_END,d0
  394.     bcc    .no_cmd
  395. .immediate
  396.     bsr.b   PerformIO__
  397. .beginio_end
  398.     movem.l    (a7)+,d1/a0/a3
  399.     rts
  400. .no_cmd    move.b    #IOERR_NOCMD,IO_ERROR(a1)
  401.     bra.b    .beginio_end
  402. *
  403. * PerformIO actually dispatches an io request.    It might be called from
  404. * the task, or directly from BeginIO (thus on the callers's schedule)
  405. *
  406. * -> a1=iorequest, a3=unitptr, a6=device
  407. *
  408. PerformIO__
  409.     moveq    #0,d0
  410.     move.b    d0,IO_ERROR(A1)        ; kein Fehler
  411.     move.b    IO_COMMAND+1(a1),d0    ; low byte
  412.     lea    cmdtable(pc),a0
  413.     move.l    (a0,d0.w*4),a0
  414.     jmp     (a0)            ; a1=ioreq, a6=devprt
  415.  
  416.  
  417.  
  418. ****************************************************************************
  419. *
  420. * AbortIO() is a REQUEST to "hurry up" processing of an IORequest.
  421. * If the IORequest was already complete, nothing happens (if an IORequest
  422. * is quick or LN_TYPE=NT_REPLYMSG, the IORequest is complete).
  423. * The message must be replied with ReplyMsg(), as normal.
  424. *
  425. * Note that AbortIO is called directly, not via BeginIO.
  426. *
  427. * If sucessful, AbortIO returns IOERR_ABORTED in IO_ERROR and zero in D0
  428. *
  429. * -> a1=iorequest, a6=device
  430. *
  431. AbortIO__
  432. ;;    moveq   #0,d0            ; error code (always successful)
  433.     moveq    #IOERR_NOCMD,d0        ; return "AbortIO() request failed"
  434.     rts
  435.  
  436.  
  437. *
  438. * -> a1=iorequest, a3=unitptr, a6=device
  439. *
  440. TermIO__
  441.     btst    #IOB_QUICK,IO_FLAGS(a1)    ; wenn quick, dann keine RyplyMsg
  442.     bne.b   .termio_end
  443.     move.l    a6,-(a7)
  444.     move.l    md_SysLib(a6),a6
  445.     jsr    -378(a6)        ;CALL ReplyMsg (sets the LN_TYPE to NT_REPLYMSG)
  446.     move.l    (a7)+,a6
  447. .termio_end
  448.     rts
  449.  
  450.  
  451. NSDQuery:
  452.     move.l    IO_DATA(a1),a0        ; NSDeviceQueryResult
  453.     move.l    IO_LENGTH(a1),d0    ; size
  454.     move    #NSDEVTYPE_UNKNOWN,dqr_DeviceType(a0)
  455.     move    #0,dqr_DeviceSubType(a0)
  456.     move.l    #cmdlist,dqr_SupportedCommands(a0)
  457.     move.l    #NSDeviceQueryResult_SIZEOF,dqr_SizeAvailable(a0)
  458.     move.l    dqr_SizeAvailable(a0),IO_ACTUAL(a1)
  459.     bra    TermIO__
  460.  
  461.  
  462. ****************************************************************************
  463. *
  464. * Setzt die aktuelle System Clock Referenze
  465. *
  466. * -> a0=unit, d0=time
  467. * <- d0=succes
  468. *
  469. SetSCR__
  470.     moveq    #0,d0
  471.     rts
  472. *
  473. * Gibt den aktuellen System Clock Reference wert
  474. *
  475. * -> a0=unit
  476. * <- d0=clockValue (die unteren 32 bits vom SCR)
  477. *
  478. GetSCR__
  479.     moveq    #0,d0
  480.     rts
  481.  
  482.  
  483.  
  484. ****************************************************************************
  485. * hier beginnnen die Funktionen der Device Befehle
  486. *
  487. * Parameter:
  488. * -> a1=iorequest, a3=unitptr, a6=device
  489. *
  490. Invalid:
  491.     move.b    #IOERR_NOCMD,IO_ERROR(a1)
  492.     bra    TermIO__
  493. *
  494. * no operation
  495. *
  496. noOp:
  497. CMD_Read__
  498. CMD_Update__
  499. CMD_Clear__
  500. CMD_Stop__
  501. CMD_Start__
  502.     clr.l    IO_ACTUAL(a1)
  503.     bra    TermIO__
  504.  
  505.  
  506. ****************************************************************************
  507. **
  508. ** MPEG device functions
  509. **
  510. * CMD_RESET - Decoder zurücksetzen
  511. *
  512. CMD_Reset__
  513. ;*** what should we do here???
  514.     bra    TermIO__
  515.  
  516.  
  517. ****************************************************************************
  518. *
  519. * CMD_FLUSH - abort all CMD_WRITE requests and flush decoder buffer
  520. *
  521. * Abspieler stoppen und alle Requests abbrechen.
  522. *
  523. CMD_Flush__
  524.     movem.l    d1-d7/a0-a6,-(a7)
  525.     move.l    a3,-(a7)        ;struct devunit*
  526.     jsr    _C_flush        ;returns nothing
  527.     addq.l    #4,a7
  528.     movem.l    (a7)+,d1-d7/a0-a6
  529.     bra    TermIO__
  530.  
  531.  
  532. ****************************************************************************
  533. *
  534. * MPEGCMD_PLAY - start playback
  535. *
  536. * In diesem Device wird die Abspielhardware in der Write Funktion gestartet.
  537. *
  538. * INPUTS:
  539. *   iomr_StreamType  - MPEGSTREAM_AUDIO, MPEGSTREAM_SYSTEM
  540. *                      oder MPEGSTREAM_BYPASS abhängig vom stream typ.
  541. *
  542. MPEG_Play:
  543. ;*** we don't need to do anything here...
  544. ;*** the first CMD_WRITE will automatically start playback
  545.     bra    TermIO__
  546.  
  547.  
  548. ****************************************************************************
  549. *
  550. * MPEGCMD_Pause - set pause mode
  551. *
  552. * INPUTS:
  553. *   iomr_StreamType  - MPEGSTREAM_AUDIO oder MPEGSTREAM_SYSTEM
  554. *                      abhängig vom stream typ.
  555. *   iomr_Arg1        - Pause-modus an: io_Arg ungleich 0
  556. *                      Pause-modus aus: io_Arg gleich 0
  557. *
  558. MPEG_Pause:
  559.     movem.l    d1-d7/a0-a6,-(a7)
  560.     move.l    a1,-(a7)        ;struct IOMPEGReq*
  561.     move.l    a3,-(a7)        ;struct devunit*
  562.     jsr    _C_setpause        ;returns nothing
  563.     addq.l    #8,a7
  564.     movem.l    (a7)+,d1-d7/a0-a6
  565.     bra    TermIO__
  566.  
  567.  
  568. ****************************************************************************
  569. *
  570. * MPEGCMD_GETDEVINFO - get device information
  571. *
  572. * INPUTS:
  573. *   IO_DATA - Zeiger auf MPEGDevInfo struktur
  574. *
  575. MPEG_GetDevInfo:
  576.     movem.l    a0-a3,-(a7)
  577.     move.l    IO_DATA(a1),a0        ; MPEGDevInfo
  578.     move    #1,mdi_Version(a0)
  579.     move    #0,mdi_Flags(a0)
  580.     move.l    #MPEGCF_PLAYRAWAUDIO|MPEGCF_PLAYAUDLAYER_II|MPEGCF_PLAYAUDLAYER_III,d0
  581.     move.l    d0,mdi_BoardCapabilities(a0)
  582.     lea    BoardDesc(pc),a2
  583.     lea    mdi_BoardDesc(a0),a3
  584.     move    #256-1,d0
  585. .copylp:
  586.     move.b    (a2)+,(a3)+
  587.     dbra    d0,.copylp
  588.     movem.l    (a7)+,a0-a3
  589.     bra    TermIO__
  590.  
  591.  
  592. ****************************************************************************
  593. *
  594. * MPEGCMD_SETAUDIOPARAMS - set playback parameter
  595. *
  596. * Hier wird die Lautstärkeregelung vorgenommen.
  597. *
  598. * INPUTS:
  599. *   IO_DATA   - Zeiger auf MPEGAudioParams structure.
  600. *   IO_LENGTH - Sizeof(struct MPEGAudioParams)
  601. *
  602. MPEG_SetAudPara:
  603.     movem.l    d1-d7/a0-a6,-(a7)
  604.     move.l    a1,-(a7)        ;struct IOMPEGReq*
  605.     move.l    a3,-(a7)        ;struct devunit*
  606.     jsr    _C_setvolume        ;returns nothing
  607.     addq.l    #8,a7
  608.     movem.l    (a7)+,d1-d7/a0-a6
  609.     bra    TermIO__
  610.  
  611.  
  612. ****************************************************************************
  613. *
  614. * CMD_WRITE - write data to play
  615. *
  616. * INPUTS:
  617. *   IO_DATA   - Zeiger auf Puffer mit Daten
  618. *   IO_LENGTH - Anzahl der Bytes im Puffer
  619. *
  620. CMD_Write__
  621.     movem.l    d1-d7/a0-a6,-(a7)
  622.     move.l    a1,-(a7)        ;struct IOMPEGReq*
  623.     move.l    a3,-(a7)        ;struct devunit*
  624.     jsr    _C_write        ;returns ULONG error
  625.     addq.l    #8,a7
  626.     movem.l    (a7)+,d1-d7/a0-a6
  627.     tst.l    d0
  628.     bne.b    .write_err
  629.     rts
  630. .write_err
  631.     bra    TermIO__
  632.  
  633.  
  634. EndCode
  635.     END
  636.